import fetch from '@/utils/fetch'

export function getRtuList(areaId, params) {
	return fetch({
	    url: '/device/v1/mgt/rtu',
	    method: 'get',
		headers: {'x-area-id': areaId},
	    params
  	})
}

export function getRtuDetail(id) {
	return fetch({
	    url: `/device/v1/mgt/rtu/${id}`,
	    method: 'get'
  	})
}

export function createRtu(data) {
	return fetch({
		url: '/device/v1/mgt/rtu',
		method: 'post',
		data
	})
}

export function modifyRtu(id, data) {
	return fetch({
	    url: `/device/v1/mgt/rtu/${id}`,
	    method: 'patch',
	    data
	})
}